<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="htmlHead :: common_header"/>
<script th:inline="javascript">
    var code = [[${code}]];
    $.post("/login",
        {code:code},
        function(data){
            if (data.success == true) {
                window.location.href = './index';
            } else {
                layer.confirm(data.message,{
                    btn: ['确定', '关闭'],
                    shade: false,
                    closeBtn: 0
                },
                function(){
                        window.location.href = "https://oa.dingtalk.com/index.htm#/microApp/microAppList";
                }, function () {
                        window.close();
                    });
            }
        });
</script>
</html>